package com.taobao.api.request;

import java.util.HashMap;
import java.util.Map;

import com.taobao.api.ApiRuleException;
import com.taobao.api.FileItem;
import com.taobao.api.TaobaoUploadRequest;
import com.taobao.api.internal.util.RequestCheckUtils;
import com.taobao.api.internal.util.TaobaoHashMap;
import com.taobao.api.response.TmallEaiOrderRefundGoodReturnRefuseResponse;

/**
 * TOP API: tmall.eai.order.refund.good.return.refuse request
 * 
 * @author auto create
 * @since 1.0, 2013-08-03 16:51:00
 */
public class TmallEaiOrderRefundGoodReturnRefuseRequest implements TaobaoUploadRequest<TmallEaiOrderRefundGoodReturnRefuseResponse> {

  private TaobaoHashMap udfParams;    // add user-defined text parameters
  private Long          timestamp;

  /**
   * 退款单编号
   */
  private Long          refundId;

  /**
   * 售中：onsale 售后：aftersale
   */
  private String        refundPhase;

  /**
   * 退款版本号
   */
  private Long          refundVersion;

  /**
   * 拒绝退款原因留言
   */
  private String        refuseMessage;

  /**
   * 拒绝退款举证上传
   */
  private FileItem      refuseProof;

  public void setRefundId(Long refundId) {
    this.refundId = refundId;
  }

  public Long getRefundId() {
    return this.refundId;
  }

  public void setRefundPhase(String refundPhase) {
    this.refundPhase = refundPhase;
  }

  public String getRefundPhase() {
    return this.refundPhase;
  }

  public void setRefundVersion(Long refundVersion) {
    this.refundVersion = refundVersion;
  }

  public Long getRefundVersion() {
    return this.refundVersion;
  }

  public void setRefuseMessage(String refuseMessage) {
    this.refuseMessage = refuseMessage;
  }

  public String getRefuseMessage() {
    return this.refuseMessage;
  }

  public void setRefuseProof(FileItem refuseProof) {
    this.refuseProof = refuseProof;
  }

  public FileItem getRefuseProof() {
    return this.refuseProof;
  }

  private Map<String, String> headerMap = new TaobaoHashMap();

  public Long getTimestamp() {
    return this.timestamp;
  }

  public void setTimestamp(Long timestamp) {
    this.timestamp = timestamp;
  }

  public String getApiMethodName() {
    return "tmall.eai.order.refund.good.return.refuse";
  }

  public Map<String, String> getTextParams() {
    TaobaoHashMap txtParams = new TaobaoHashMap();
    txtParams.put("refund_id", this.refundId);
    txtParams.put("refund_phase", this.refundPhase);
    txtParams.put("refund_version", this.refundVersion);
    txtParams.put("refuse_message", this.refuseMessage);
    if (this.udfParams != null) {
      txtParams.putAll(this.udfParams);
    }
    return txtParams;
  }

  public void putOtherTextParam(String key, String value) {
    if (this.udfParams == null) {
      this.udfParams = new TaobaoHashMap();
    }
    this.udfParams.put(key, value);
  }

  public Map<String, FileItem> getFileParams() {
    Map<String, FileItem> params = new HashMap<String, FileItem>();
    params.put("refuse_proof", this.refuseProof);
    return params;
  }

  public Class<TmallEaiOrderRefundGoodReturnRefuseResponse> getResponseClass() {
    return TmallEaiOrderRefundGoodReturnRefuseResponse.class;
  }

  public void check() throws ApiRuleException {

    RequestCheckUtils.checkNotEmpty(refundId, "refundId");
    RequestCheckUtils.checkNotEmpty(refundPhase, "refundPhase");
    RequestCheckUtils.checkNotEmpty(refundVersion, "refundVersion");
    RequestCheckUtils.checkNotEmpty(refuseMessage, "refuseMessage");
    RequestCheckUtils.checkNotEmpty(refuseProof, "refuseProof");
  }

  public Map<String, String> getHeaderMap() {
    return headerMap;
  }
}
